package cn.eclass.bean;

import cn.eclass.bean.api.ISchoolBean;
import cn.eclass.dao.SchoolDao;
import cn.eclass.entity.SchoolEntity;
import java.util.List;

public class SchoolBean implements ISchoolBean {

    SchoolDao dao = new SchoolDao();

    @Override
    public SchoolEntity getByName(String name) {
    	return dao.getByName(name);
    }
    
    @Override
    public SchoolEntity add(SchoolEntity entity) {
        int newId = dao.add(entity);
        entity.setId(newId);
        return entity;
    }

    @Override
    public boolean update(SchoolEntity entity) {
        return dao.update(entity);
    }

    @Override
    public boolean delete(int id) {
        return dao.delete(id);
    }

    @Override
    public SchoolEntity get(int id) {
        return dao.get(id);
    }

    @Override
    public List<SchoolEntity> list() {
        return dao.list();
    }
}
